<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>slot-作用域插槽</title>
</head>
<script src="../js/vue.js"></script>
<body>

<div id="app">

    <names>
        <template slot-scope="slot">
            <ul>
                <li>{{slot.data}}</li>
            </ul>
        </template>
    </names>

    <names>
        <template slot-scope="slot">
            <h1>{{slot.data}} ----</h1>
        </template>
    </names>
</div>

</body>

<template id="names">
    <slot :data="names">
        <h2 v-for="item in names">{{names}}</h2>
    </slot>
</template>

<script>
    const vue = new Vue({
        'el': '#app',
        'data': {},
        'methods': {},
        components: {
            names: {
                template: '#names',
                data() {
                    return {
                        names: ['周杰伦', '五月天', '许嵩', '熊大', '熊二']
                    }
                }
            }
        }
    })
</script>
</html>